package com.cndw.kungfu.dao;

import java.util.List;

import com.cndw.dao.jade.annotation.DAO;
import com.cndw.dao.jade.annotation.SQL;
import com.cndw.dao.jade.annotation.SQLParam;

import com.cndw.kungfu.domain.Npc;

@DAO
public interface NpcDao {
	public static final String TABLE = " kfsys_npc ";
	
	public static final String FIELDS = " id,name,deputyName,icon,sceneId,x,y,scriptIds,isHidden,isClick,extAttribute,forbidenArea,activeArea,basePoint,dialog  ";
	
	/**
	 * 根据id查npc
	 * @param id
	 * @return
	 */
	@SQL("select "+FIELDS+" from  "+TABLE+" where id=:id ")
	public Npc getById(@SQLParam("id") int id);
	
	
	
	/**
	 * 根据id列表查npc
	 * @param npcIds
	 * @return
	 */
	@SQL("select "+FIELDS+" from  "+TABLE+" where id in (:ids)")
	public List<Npc> getByIds(@SQLParam("ids") long[] npcIds);
	
	
	/**
	 * 根据id列表查npc
	 * @param npcIds
	 * @return
	 */
	@SQL("select "+FIELDS+" from  "+TABLE+" order by id asc")
	public List<Npc> getAllNpcsFromDb();
	
}
